<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>练习1</title>
  </head>
  <body>
    <script>
      // 打印1-100之间7的倍数的个数及总和
      var num = 0,
        sum = 0;
      for (var i = 1; i <= 100; i++) {
        if (i % 7 === 0) {
          num++;
          sum += i;
        }
      }
      console.log(
        "1-100之间7的倍数的个数为",
        num,
        "1-100之间7的倍数的总和为",
        sum
      );
    </script>
  </body>
</html>
